package com.flyqiu.flow.core.fliter;


import com.flyqiu.flow.bpmn.element.BaseProcElement;
import com.flyqiu.flow.bpmn.element.SequenceFlow;


public interface BpmnElementFilter {
    /**
     * 是否包含起始元素
     *
     * @return
     */
    default boolean isIncludeStartingElement() {
        return false;
    }

    /**
     * 查找到元素
     *
     * @param level       层级
     * @param flowElement 层级查找到的元素
     * @return 返回true 继续查找子级 false 停止查找子级
     */
    boolean filter(int level, BaseProcElement flowElement);

    /**
     * @param elementType
     * @return
     */
    default boolean selectedElementType(String elementType) {
        return true;
    }

    /**
     * 处理连线条件
     *
     * @param sequenceFlow
     * @return
     */
    default boolean handlerSequenceFlow(SequenceFlow sequenceFlow) {
        return true;
    }

    /**
     * @return
     */
    default boolean continueNextLevel(int currentLevel, int nextLevel) {
        return true;
    }
}
